package hhm.javamode.visitor.shoppingcart;

public class Test {

	public static void main(String[] args) {
		ItemElement[] items = new ItemElement[] { new Book(20, "1234"), new Book(100, "5678"),
				new Fruit(10, 2, "Banana"), new Fruit(5, 5, "Apple") };

		int sum = 0;
		for (ItemElement item : items) {
			sum = sum + item.accept(new ShoppingCartVisitorImpl());
		}
		System.out.println("Total Cost = " + sum);
	}

}
